﻿using Newtonsoft.Json;
using System;

namespace T.FAS.Runtime.Metadata.Entity.DataModel
{
    /// <summary>
    /// 数据查询-变量参数
    /// </summary>
    [Serializable]
    public class DataQueryParam : System.ICloneable
    {
        /// <summary>
        /// 主键id
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 数据查询id
        /// </summary>
        public string DataQueryID { get; set; }

        /// <summary>
        /// 变量名称
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 变量说明
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 是否表达式 0:否 1:是
        /// </summary>
        public bool IsExpr { get; set; }

        /// <summary>
        /// 标识：0:变量 1:参数
        /// </summary>
        public bool IsInputParam { get; set; }

        /// <summary>
        /// true:系统默认参数，false:用户自定义参数
        /// </summary>
        public bool IsDefault { get; set; }

        /// <summary>
        /// 参数类型,string numeric等基本类型，
        /// </summary>
        public string ParamType { get; set; }

        /// <summary>
        /// 变量默认值：当参数类型为非公开参数时，必须赋默认值
        /// </summary>
        public string DefaultValue { get; set; }

        /// <summary>
        /// 变量值，参数传入值
        /// </summary>
        public string ParamValue { get; set; }
        
        /// <summary>
        /// 变量表达式json
        /// </summary>
        public string ExpressJson { get; set; }

        /// <summary>
        /// 是否可空，true为可空，false不可空
        /// </summary>
        public bool IsAllowNull { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext1 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext2 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext3 { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [JsonIgnore]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>        
        [JsonIgnore]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        [JsonIgnore]
        public string LastModifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>        
        [JsonIgnore]
        public DateTime LastModifyTime { get; set; }

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
